package com.smh.a04objectStreamDemo1;

import java.io.Serializable;

//没有抽象,标记型接口
public class Student implements Serializable {
    //@Serial
    private static final long serialVersionUID = 915179520232371682L;
    //    //定义版本号
//    @Serial
//    private static final long serialVersionUID = 1L;
//    //私有  共享   最终  数据类型  变量名,只能是这个名字
    private String name;
    private int age;
    private String gender;
    //transient瞬态关键字,在序列化时不会序列到本地
    private transient String address;

    public Student() {
    }

    public Student(String name, int age, String gender, String address) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.address = address;
    }

    /**
     * 获取
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     *
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     *
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * 获取
     *
     * @return gender
     */
    public String getGender() {
        return gender;
    }

    /**
     * 设置
     *
     * @param gender
     */
    public void setGender(String gender) {
        this.gender = gender;
    }

    /**
     * 获取
     *
     * @return address
     */
    public String getAddress() {
        return address;
    }

    /**
     * 设置
     *
     * @param address
     */
    public void setAddress(String address) {
        this.address = address;
    }

    public String toString() {
        return "Student{name = " + name + ", age = " + age + ", gender = " + gender + ", address = " + address + "}";
    }
}
